package com.yiyuan.app.entity.enums;

/**
 * @Author: sunxuzong
 * @Date: 2024/07/19
 */
public enum PeriodEnum {
    daily("daily","每天领取一次"),
    monthly("monthly","每月领取一次")
    ;

    private String code;

    private String desc;

    PeriodEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static PeriodEnum getByCode(String code){
        for (PeriodEnum enums : PeriodEnum.values()){
            if (enums.getCode().equals(code)){
                return enums;
            }
        }
        return  null;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
